import { axios } from '@/utils/request'

// 登录
export function login(data) {
  return axios({
    url: '/sys/login',
    method: 'post',
    data: data
  })
}

// 获取用户信息
export function getInfo() {
  return axios({
    url: '/sys/user',
    method: 'get'
  })
}

// 登出
export function logout() {
  return axios({
    url: '/sys/logout',
    method: 'post'
  })
}

// 新增、编辑用户
export function saveUser(data) {
  return axios({
    url: '/sys/user/save',
    method: 'post',
    data: data
  })
}

// 根据id获取用户信息
export function getUserById(id) {
  return axios({
    url: '/sys/user/getById/' + id,
    method: 'get'
  })
}

// 删除
export function deleteUser(ids) {
  return axios({
    url: '/sys/user/del?ids=' + ids,
    method: 'delete'
  })
}
